<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib  uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>我的简历 - 锐聘网</title>
<link href="<%=basePath%>/css/base.css" type="text/css" rel="stylesheet" />
<link href="<%=basePath%>/css/my_resume.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="<%=basePath%>js/jquery.min.js"></script>
<meta content="大学生求职,大学生就业,大学生招聘,IT人才,IT人才招聘,大学生名企招聘,,大学生找工作,IT名企招聘，IT行业招聘，IT企业快速入职" name="keywords">
<meta content="锐聘专注于为企业提供高效的人力资源解决方案，同时面向IT类技术人才推出快速一站式免费就业服务。秉承QST青软实训人才服务理念，为数千家企业量身定做个性化、全程化的人才培养体系，同时帮助中高级人才铺设成功之路，为人才和企业架设起沟通之桥。" name="description">
<!-- zxh -->
<script type="text/javascript">
	function showaddform(){
	$("#educationshow").hide();
	$("#educationadd").show();
	
	}
	$(function(){
	$("#edusave").on("click",function(){
		var school=$("#school");
		var beginTime=$("#beginTime");
		var schooling=$("#schooling");
		var profession=$("#profession");
		if(school.val()==null||school.val()==""){
		alert("毕业院校不能为空！请重输");
		school.focus();
		return false;
		}
		if(beginTime.val()==null||beginTime.val()==""){
		alert("就读时间不能为空！请重输");
		beginTime.focus();
		return false;
		}
		$.ajax({
			url:"edu.do?type=save",//返回的Url地址
			type:"POST",//请求方式
			dataType:"JSON",//服务器返回的数据类型
			data:{school:school.val(),beginTime:beginTime.val(),schooling:schooling.val(),profession:profession.val()},  //传递的参数
			success:function(data){//返回成功的操作
				if(data.code=='0'){
				var edushow=$("#educationshow");
				var s="";
				edushow.show();//显示教育经历div
				edushow.empty();//清空div下所有的子元素(不包含本身)
				var str="<ul><li class='tn-border-gray tn-border-bottom it-table-grid-header'><p class='tn-name'>毕业院校</p><p class='tn-date'>就读时间</p><p class='tn-degree'> 学历</p><p class='tn-fieldofstudy'>专业</p></li>";
					
					$.each(data.edulist,function(index,obj){//第一个表示集合的下标，第二个参数表示这个集合的对象
						/* alert("name:"+index); */
						  html = "<li class='tn-border-gray tn-border-bottom'><p class='tn-name' title='青软实训'>"+obj.school+"</p>"+
					        "<p class='tn-date'>"+obj.beginTime+"</p>"+
					        "<p class='tn-degree' title='学历'>"+obj.schooling+"</p>"+
					        "<p class='tn-fieldofstudy' title='软件工程'>"+obj.profession+"</p>"+
					        "<span class='tn-actions'><a href='javascript:void(0)' class='tn-action tn-action-text-icon' onclick='modify(this)'><span class='tn-icon it-icon-modify'></span><span class='tn-action-text'>修改</span></a><a href='javascript:void(0)' onclick ='del(this,"+education_id+")' class='tn-action tn-action-text-icon tn-delete'>"+
					        "<span class='tn-icon it-icon-delete'></span><span class='tn-action-text'>删除</span></a></span></li>";   
							s+=html;
						});

					var ul="</ul>";
					var result=str+s+ul;
					$(result).appendTo(edushow);
					$("#educationadd").hide();
				}
			},
			error:function(){//请求失败要执行的操作
			}
		});
	});
		});
	//点击修改 直接在input标签中修改值，“修改”按钮变为“保存”按钮。	.trim() 去掉字符串前后导空格	
  function modify(obj){
      var parent =$(obj).parent().parent(); //html dom对象  jquery对象  $()可以把Dom对象转成Jquery对象
      var p =parent.children("p");//获取到所有的子元素<p>
      var education_id=parent.children("input").val();//获取要修改的教育经历的id号
      html ="<li class='tn-border-gray tn-border-bottom'><p class='tn-name' title='青软实训'><input type='hidden' name='education_id' value='"+education_id+"'></input><input type='text' name='school' value='"+$(p[0]).text().trim()+"'></input></p>"+
					        "<p class='tn-date'><input type='text' name='beginTime' value='"+$(p[1]).text().trim()+"'></input></p>"+
					        "<p class='tn-degree' title='学历'><input type='text' name='schooling' value='"+$(p[2]).text().trim()+"'></input></p>"+
					        "<p class='tn-fieldofstudy' title='软件工程'><input type='text' name='profession' value='"+$(p[3]).text().trim()+"'></input></p>"+
					        "<span class='tn-actions'><a href='javascript:void(0)' class='tn-action tn-action-text-icon'  onclick='update(this)'><span class='tn-icon it-icon-modify' ></span><span class='tn-action-text'>保存</span></a> <a href='javascript:void(0)' class='tn-action tn-action-text-icon tn-delete' >"+
					        "<span class='tn-icon it-icon-delete'></span><span class='tn-action-text'>删除</span></a></span></li>";
        $(parent).after(html);
        $(parent).remove();
       
   }
   //点击“保存”后，input标签转换为p标签，并写入数据库，“保存”按钮变为“修改”按钮。
   function update(obj){
   		var parent =$(obj).parent().parent(); //html dom对象  jquery对象  $()可以把Dom对象转成Jque
   		var education_id= $(obj).parent().parent().find("input[name='education_id']").val();
   		var beginTime= $(obj).parent().parent().find("input[name='beginTime']").val();
   		var schooling= $(obj).parent().parent().find("input[name='schooling']").val();
   		var profession= $(obj).parent().parent().find("input[name='profession']").val();
   		var school= $(obj).parent().parent().find("input[name='school']").val();
   		$.ajax({
   			url:"edu.do?type=update",
   			type:"POST",
   			dataType:"JSON",
   			data:{education_id:education_id,beginTime:beginTime,schooling:schooling,profession:profession,school:school},  //传递的参数
			success:function(data){//返回成功的操作
				if(data.code==0){
				 html ="<li class='tn-border-gray tn-border-bottom'><p class='tn-name' title='青软实训'>"+school+"</p>"+
					        "<p class='tn-date'>"+beginTime+"</p>"+
					        "<p class='tn-degree' title='学历'>"+schooling+"</p>"+
					        "<p class='tn-fieldofstudy' title='软件工程'>"+profession+"</p>"+
					        "<span class='tn-actions'><a href='javascript:void(0)' class='tn-action tn-action-text-icon'  onclick='modify(this)'><span class='tn-icon it-icon-modify' ></span><span class='tn-action-text'>修改</span></a> <a href='javascript:void(0)'   class='tn-action tn-action-text-icon tn-delete' >"+
					        "<span class='tn-icon it-icon-delete'></span><span class='tn-action-text'>删除</span></a></span></li>";
				        	$(parent).after(html);
				        	$(parent).remove();
				}
			},
			error:function(){//请求失败要执行的操作
			}
   		
   		});
   		//alert($(education_id[0]).val());//第0个input的value值
   }		
 function del(obj,id){
		var parent =$(obj).parent().parent(); //html dom对象  jquery对象  $()可以把Dom对象转成Jque
		$.ajax({
   			url:"edu.do?type=delete",
   			type:"POST",
   			dataType:"JSON",
   			data:{education_id:id},  //传递的参数
			success:function(data){//返回成功的操作
				//alert(data);
				parent.remove();
			},
			error:function(){//请求失败要执行的操作
			}
   		
   		});
	}	
		
</script>

</head>

<body>

<jsp:include page="../top.jsp"></jsp:include>
<div class="resume_con">
	<!--tab设置-->
	<div class="user_operate">
		<ul style="float:left">
			<li><a href="resume.html" class="active">我的简历</a></li>
			<li><a href="jobApply.html">我的申请</a></li>
			<div class="clear"></div>
		</ul>
		<div class="clear"></div>
	</div>
    <!--主体部分-->
    <div class="resume_main">
    	<!--左边-->
	    <div class="resume_left">
			<div class="resume_title">
				<div style="float:left">基本信息</div>
				<div class="btn"><a href="resume.do?type=update">修改</a></div>
			</div>
			<div class="all_resume">
				<div class="table_style">
					<table width="300" border="0" cellpadding="3" cellspacing="1" bgcolor="#EEEEEE">
					  <tr>
					    <th width="110" align="right" bgcolor="#F8F8F8">姓名：</th>
					    <td bgcolor="#F8F8F8">${resuemInfo.realName}</td>
					  </tr>
					</table>
					<div class="he"></div>
					<table width="300" border="0" cellpadding="3" cellspacing="1" bgcolor="#EEEEEE">
					  <tr>
					    <th width="110" align="right" bgcolor="#F8F8F8">性别：</th>
					    <td bgcolor="#F8F8F8">${resuemInfo.gender}</td>
					  </tr>
					</table>
					<div class="he"></div>
					<table width="300" border="0" cellpadding="3" cellspacing="1" bgcolor="#EEEEEE">
					  <tr>
					    <th width="110" align="right" bgcolor="#F8F8F8">出生日期：</th>
					    <td bgcolor="#F8F8F8">${resuemInfo.birthday}</td>
					  </tr>
					</table>
					<div class="he"></div>
					<table width="300" border="0" cellpadding="3" cellspacing="1" bgcolor="#EEEEEE">
					  <tr>
					    <th width="110" align="right" bgcolor="#F8F8F8">手机：</th>
					    <td bgcolor="#F8F8F8">${resuemInfo.telephone}</td>
					  </tr>
					</table>
					<div class="he"></div>
					<table width="300" border="0" cellpadding="3" cellspacing="1" bgcolor="#EEEEEE">
					  <tr>
					    <th width="110" align="right" bgcolor="#F8F8F8">邮件：</th>
					    <td bgcolor="#F8F8F8">${resuemInfo.email}</td>
					  </tr>
					</table>
					<div class="he"></div>
					<table width="300" border="0" cellpadding="3" cellspacing="1" bgcolor="#EEEEEE">
					  <tr>
					    <th width="110" align="right" bgcolor="#F8F8F8">求职意向：</th>
					    <td bgcolor="#F8F8F8">${resuemInfo.jobIntension}</td>
					  </tr>
					</table>
					<div class="he"></div>
					<table width="300" border="0" cellpadding="3" cellspacing="1" bgcolor="#EEEEEE">
					  <tr>
					    <th width="110" align="right" bgcolor="#F8F8F8">工作经验：</th>
					    <td bgcolor="#F8F8F8">${resuemInfo.jobExperience}</td>
					  </tr>
					</table>
					<div class="he"></div>
				</div>
				<div style="float:right" class="uploade">
				<c:if test="${empty resuemInfo.headShot}">
					<img src = "<%=basePath%>images/person_img.jpg">
				</c:if>
				<c:if test="${!empty resuemInfo.headShot}">
					<img src = "<%=basePath%>applicant/images/${resuemInfo.headShot}" width="110px" height="110px">	
				</c:if>
					<div align="center">
						<a href="<%=basePath%>applicant/ResumeBasicInfoPicUpload.jsp" class="uploade_btn">更换照片</a>
					</div>
				</div>
				<div class="clear"></div>
			</div>
			<div class="resume_title">
				<div style="float:left">教育经历</div>
				<div class="btn"><a href="javascript:void(0)" onclick="showaddform()">添加</a></div>
			</div>
			<!-- 显示教育经历begin -->
			<div class="it-table-grid" id="educationshow">
		    	<ul>
		    		 <li class="tn-border-gray tn-border-bottom it-table-grid-header">
			            <p class="tn-name">
			                毕业院校</p>
			            <p class="tn-date">
			                就读时间</p>
			            <p class="tn-degree">
			                学历</p>
			            <p class="tn-fieldofstudy">
			                专业</p>
			        </li>
			<!--将添加到数据库的信息显示到此地-->
			<c:if test="${!empty edulist}">
				 <c:forEach items="${edulist}" var="education">
				 
					<li class="tn-border-gray tn-border-bottom">
						<input type="hidden" name="education_id" value="${education.education_id}"/>
			            <p class="tn-name" title="毕业院校">
			                  ${education.school}    
			            </p>
			            <p class="tn-date"> ${education.beginTime}</p>
			            <p class="tn-degree" title="学历">
			               ${education.schooling}    
			            </p>
			            <p class="tn-fieldofstudy" title="专业">
			         		${education.profession}    
			            </p>
			            <span class="tn-actions"><a href="javascript:void(0)" class="tn-action tn-action-text-icon" onclick="modify(this);">
			            <span class="tn-icon it-icon-modify"></span><span class="tn-action-text">修改</span>
			            </a>
			            <a href="javascript:void(0)" class="tn-action tn-action-text-icon tn-delete" onclick="del(this,${education.education_id})">
			            <span class="tn-icon it-icon-delete"></span><span class="tn-action-text">删除</span>
			            </a></span></li>    
				
				</c:forEach>
			</c:if>
				</ul>
			</div>
			<!-- 显示教育经历 end -->
			
			
			<!-- 显示教育经历添加begin -->
			<div class="it-table-grid" style="display: none;" id="educationadd">
			<form action="<%=basePath%>edu.do" method="post">
			<div class="all_resume">
				<div class="table_style" style="margin-left:150px">
					<table width="300" border="0" cellpadding="3" cellspacing="1" bgcolor="#EEEEEE">
					  <tr>
					    <th width="110" align="right" bgcolor="#F8F8F8">毕业学院：</th>
					    <td bgcolor="#F8F8F8"><input type="text" name="school" id="school"></td>
					  </tr>
					</table>
					<div class="he"></div>
					
					<div class="he"></div>
					<table width="300" border="0" cellpadding="3" cellspacing="1" bgcolor="#EEEEEE">
					  <tr>
					    <th width="110" align="right" bgcolor="#F8F8F8">就读时间：</th>
					    <td bgcolor="#F8F8F8"><input type="text" name="beginTime" id="beginTime"></td>
					  </tr>
					</table>
					<div class="he"></div>
					<table width="300" border="0" cellpadding="3" cellspacing="1" bgcolor="#EEEEEE">
					  <tr>
					    <th width="110" align="right" bgcolor="#F8F8F8">学历</th>
					    <td bgcolor="#F8F8F8"><input type="text" name="schooling" id="schooling"></td>
					  </tr>
					</table>
					<div class="he"></div>
					<table width="300" border="0" cellpadding="3" cellspacing="1" bgcolor="#EEEEEE">
					  <tr>
					    <th width="110" align="right" bgcolor="#F8F8F8">专业</th>
					    <td bgcolor="#F8F8F8"><input type="text" name="profession" id="profession"></td>
					  </tr>
					</table>
					<div class="he"></div>
					
					<div class="he"></div>
					
					<div class="he"></div>
					<div class="he"></div>
					<div align="center"><input  type="button" class="save1" value="保存" id="edusave"> 
					<input  type="reset" class="cancel2" value="取消"></div>
				</div>
				<div class="clear"></div>
			</div>
			</form>
			</div>
			<!-- 显示教育经历添加end -->
			
			<div class="resume_title">
				<div style="float:left">工作经历</div>
				<div class="btn">添加</div>
			</div>
			<div class="it-table-grid">
		    	<ul>
			        <li class="tn-border-gray tn-border-bottom it-table-grid-header">
			            <p class="tn-name">
			                工作公司	</p>
			            <p class="tn-date">
			                在职时间</p>
			            <p class="tn-degree">
			                部门</p>
			            <p class="tn-fieldofstudy">
			                职位名称</p>
			        </li>
					<li class="tn-border-gray tn-border-bottom">
			            <p class="tn-name" title="青软实训">
			                青软实训                   
			            </p>
			            <p class="tn-date">2013/10-2014/10</p>
			            <p class="tn-degree" title="">
			                 研发部
			            </p>
			            <p class="tn-fieldofstudy" title="软件工程">
			                软件开发工程师
			            </p>
			            <span class="tn-actions"><a href="#" class="tn-action tn-action-text-icon">
			            <span class="tn-icon it-icon-modify"></span><span class="tn-action-text">修改</span>
			            </a>
			            <a href="" class="tn-action tn-action-text-icon tn-delete">
			            <span class="tn-icon it-icon-delete"></span><span class="tn-action-text">删除</span>
			            </a></span></li>    
		       
				</ul>
			</div>

			<div class="resume_title">
				<div style="float:left">项目经验</div>
				<div class="btn">添加</div>
			</div>
			<div class="it-table-grid">
		    	<ul>
			        <li class="tn-border-gray tn-border-bottom it-table-grid-header">
			            <p class="tn-name">
			                项目名称	</p>
			            <p class="tn-date">
			                参与时间</p>
			            <p class="tn-degree">
			                担任职位</p>
			        </li>
					    
		       
				</ul>
			</div>
			<div class="resume_title">
				<div style="float:left">培训经历</div>
				<div class="btn">添加</div>
			</div>
			<div class="it-table-grid">
		    	<ul>
			        <li class="tn-border-gray tn-border-bottom it-table-grid-header">
			            <p class="tn-name">
			                培训名称	</p>
			            <p class="tn-date">
			                培训时间</p>
			            
			        </li>

		       
				</ul>
			</div>
			<div class="resume_title">
				<div style="float:left">获得证书</div>
				<div class="btn">添加</div>
			</div>
			<div class="it-table-grid">
		    	<ul>
			        <li class="tn-border-gray tn-border-bottom it-table-grid-header">
			            <p class="tn-name">
			                证书名称	</p>
			            
			        </li>

		       
				</ul>
			</div>
			<div class="resume_title">
				<div style="float:left">语言能力</div>
				<div class="btn">添加</div>
			</div>

			<div class="it-table-grid">
		    	<ul>
			        <li class="tn-border-gray tn-border-bottom it-table-grid-header">
			            <p class="tn-name">
			                语言	</p>
			            <p class="tn-date">
			                听说</p>
			            <p class="tn-degree">
			                读写</p>
			            <p class="tn-fieldofstudy">
			                等级考试</p>
			        </li>
					<li class="tn-border-gray tn-border-bottom">
			            <p class="tn-name" title="英语">
			                英语                   
			            </p>
			            <p class="tn-date">熟练</p>
			            <p class="tn-degree" title="">
			                 熟练
			            </p>
			            <p class="tn-fieldofstudy" title="CET-6">
			                CET-6
			            </p>
			            <span class="tn-actions"><a href="#" class="tn-action tn-action-text-icon" >
			            <span class="tn-icon it-icon-modify"></span><span class="tn-action-text">修改</span>
			            </a>
			            <a href="" class="tn-action tn-action-text-icon tn-delete">
			            <span class="tn-icon it-icon-delete"></span><span class="tn-action-text">删除</span>
			            </a></span></li>    
		       
				</ul>
			</div>	
			<div class="resume_title">
				<div style="float:left">IT技能</div>
				<div class="btn">添加</div>
			</div>
			<div class="it-table-grid">
		    	<ul>
			        <li class="tn-border-gray tn-border-bottom it-table-grid-header">
						<p class="tn-auto">
		                技能名称</p>

			            <p class="tn-name">
		                熟练程度</p>
			        </li>
					<li class="tn-border-gray tn-border-bottom">
			            <p class="tn-auto">
		                    Oracle</p>
			            <p class="tn-name">
		                    熟练</p>
			            <span class="tn-actions"><a href="#" class="tn-action tn-action-text-icon">
			            <span class="tn-icon it-icon-modify"></span><span class="tn-action-text">修改</span>
			            </a>
			            <a href="" class="tn-action tn-action-text-icon tn-delete">
			            <span class="tn-icon it-icon-delete"></span><span class="tn-action-text">删除</span>
			            </a></span></li>    
					<li class="tn-border-gray tn-border-bottom">
			            <p class="tn-auto">
		                    JavaEE</p>
			            <p class="tn-name">
		                    熟练</p>
			            <span class="tn-actions"><a href="#" class="tn-action tn-action-text-icon">
			            <span class="tn-icon it-icon-modify"></span><span class="tn-action-text">修改</span>
			            </a>
			            <a href="" class="tn-action tn-action-text-icon tn-delete">
			            <span class="tn-icon it-icon-delete"></span><span class="tn-action-text">删除</span>
			            </a></span></li>    
					<li class="tn-border-gray tn-border-bottom">
			            <p class="tn-auto">
		                    Java</p>
			            <p class="tn-name">
		                    熟练</p>
			            <span class="tn-actions"><a href="#" class="tn-action tn-action-text-icon">
			            <span class="tn-icon it-icon-modify"></span><span class="tn-action-text">修改</span>
			            </a>
			            <a href="" class="tn-action tn-action-text-icon tn-delete">
			            <span class="tn-icon it-icon-delete"></span><span class="tn-action-text">删除</span>
			            </a></span></li>    
		       
				</ul>
			</div>	
			<div class="resume_title">
				<div style="float:left">其他信息</div>
				<div class="btn">添加</div>
			</div>
			<div class="it-table-grid">
		    	<ul>
			        <li class="tn-border-gray tn-border-bottom it-table-grid-header">
			            <p class="tn-name">
		                标题</p>
			            <p class="tn-auto">
		                描述</p>
			        </li>


		       
				</ul>
			</div>
			<div class="resume_title">
				<div style="float:left">简历附件</div>
				<div class="btn">添加</div>
			</div>
			<div class="it-table-grid">
				<div class="it-table-grid">
					暂无附件！</div>
			</div>	

		
	    </div>
    	<!--右边-->
		<%@include file="resume_right.jsp"%>

		<div style="clear:both"></div>
	</div>
</div>
<jsp:include page="../foot.jsp"></jsp:include>
</body>
</html>

